package com.java.huxb.day06;

import com.java.huxb.day06.entity.Student;

import java.io.PrintStream;
import java.util.Optional;

/**
 * @author huxb
 * @date 2020/4/14 0014 下午 10:44
 */
public class OptionalTest {
    public static void main(String[] args) {
        Student stu = new Student();
        System.out.println(Optional.ofNullable(stu).map(s -> s.getStudentName()).orElse(null));

    }
}
